//
// Copyright (C) OpenSim Ltd.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//


#ifndef Router_H_
#define Router_H_

#include <omnetpp.h>
#include <vector>

#include "inet/common/INETDefs.h"
#include "inet/networklayer/contract/ipv4/Ipv4Address.h"
#include "ACLSingleEntry_m.h"

struct ACLEntry{
    inet::Ipv4Address SourceAddress;
    inet::Ipv4Address DestAddress;
    inet::Ipv4Address NextHopAddress;
    int SourcePort;
    int interfaceID;
    int priority;
    int protocolID;
};


namespace inet {
class Router : public omnetpp::cSimpleModule {
protected:
    int portcount;
    virtual void initialize(){
        enablePFC=par("enablePFC");
        enableECN=par("enableECN");
    }
    void handleMessage(omnetpp::cMessage *msg);
    // ACL table
    void addACLEntry(ACLEntry ae);
    bool needReadACLTable = false;
    ACLEntry entryToForward;
public:
    bool enablePFC;
    bool enableECN;
    std::vector<ACLEntry> ACLTable;
    virtual bool getNeedReadACLTable() {
        return needReadACLTable;
    }
    virtual ACLEntry getEntryToForward(){
        return entryToForward;
    }
};
}
#endif /* Router_H_ */
